﻿using System;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;

namespace MyClass
{
    class Program
    {
        static void Main(string[] args)
        {
            //string strHost;
            //Console.Write("Input host : "); //INhập Host name
            //strHost = Console.ReadLine();
            //IPHostEntry IPHost = Dns.Resolve(strHost); // Phân giải DNS
            //Console.WriteLine(IPHost.HostName);
            //IPAddress[] address = IPHost.AddressList; // mảng danh sách IP
            //Console.WriteLine("List IP {0} :", IPHost.HostName);
            //for (int i = 0; i < address.Length; i++)
            //    Console.WriteLine(address[i]);
            //Console.ReadKey();
            IPGlobalProperties network = IPGlobalProperties.GetIPGlobalProperties();
            TcpConnectionInformation[] connections = network.GetActiveTcpConnections();
            Console.WriteLine(connections);
        }

        
    }
}
